{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'You are logged in as a guest:guest'"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import tradingeconomics as te\n",
    "te.login()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{u'Albania': {u'Holidays': [{'Actual': u'', 'Reference': u'', 'Importance': 1L, 'Forecast': u'', 'Source': u'', 'CalendarId': u'183323', 'Date': u'2019-04-08T00:00:00', 'TEForecast': u'', 'Event': u'Orthodox Easter Sunday', 'Unit': u'', 'Previous': u''}]}, u'Kosovo': {u'Holidays': [{'Actual': u'', 'Reference': u'', 'Importance': 1L, 'Forecast': u'', 'Source': u'', 'CalendarId': u'183322', 'Date': u'2019-04-08T00:00:00', 'TEForecast': u'', 'Event': u'Orthodox Easter Sunday', 'Unit': u'', 'Previous': u''}]}, u'Egypt': {u'Holidays': [{'Actual': u'', 'Reference': u'', 'Importance': 1L, 'Forecast': u'', 'Source': u'', 'CalendarId': u'183321', 'Date': u'2019-04-08T00:00:00', 'TEForecast': u'', 'Event': u'Coptic Easter Sunday', 'Unit': u'', 'Previous': u''}]}, u'Macedonia': {u'Holidays': [{'Actual': u'', 'Reference': u'', 'Importance': 1L, 'Forecast': u'', 'Source': u'', 'CalendarId': u'183315', 'Date': u'2019-04-08T00:00:00', 'TEForecast': u'', 'Event': u'Orthodox Easter Sunday', 'Unit': u'', 'Previous': u''}]}, u'Ethiopia': {u'Holidays': [{'Actual': u'', 'Reference': u'', 'Importance': 1L, 'Forecast': u'', 'Source': u'', 'CalendarId': u'183326', 'Date': u'2019-04-08T00:00:00', 'TEForecast': u'', 'Event': u'Easter Sunday', 'Unit': u'', 'Previous': u''}]}, u'Georgia': {u'Holidays': [{'Actual': u'', 'Reference': u'', 'Importance': 1L, 'Forecast': u'', 'Source': u'', 'CalendarId': u'183313', 'Date': u'2019-04-08T00:00:00', 'TEForecast': u'', 'Event': u'Orthodox Easter Sunday', 'Unit': u'', 'Previous': u''}]}, u'Bosnia and Herzegovina': {u'Holidays': [{'Actual': u'', 'Reference': u'', 'Importance': 1L, 'Forecast': u'', 'Source': u'', 'CalendarId': u'183325', 'Date': u'2019-04-08T00:00:00', 'TEForecast': u'', 'Event': u'Orthodox Easter Sunday', 'Unit': u'', 'Previous': u''}]}, u'Greece': {u'Holidays': [{'Actual': u'', 'Reference': u'', 'Importance': 1L, 'Forecast': u'', 'Source': u'', 'CalendarId': u'183318', 'Date': u'2019-04-08T00:00:00', 'TEForecast': u'', 'Event': u'Orthodox Easter Sunday', 'Unit': u'', 'Previous': u''}]}, u'Cyprus': {u'Holidays': [{'Actual': u'', 'Reference': u'', 'Importance': 1L, 'Forecast': u'', 'Source': u'', 'CalendarId': u'183316', 'Date': u'2019-04-08T00:00:00', 'TEForecast': u'', 'Event': u'Orthodox Easter Sunday', 'Unit': u'', 'Previous': u''}]}, u'Bulgaria': {u'Holidays': [{'Actual': u'', 'Reference': u'', 'Importance': 1L, 'Forecast': u'', 'Source': u'', 'CalendarId': u'183312', 'Date': u'2019-04-08T00:00:00', 'TEForecast': u'', 'Event': u'Orthodox Easter Sunday', 'Unit': u'', 'Previous': u''}]}}\n"
     ]
    }
   ],
   "source": [
    "a = te.getCalendarData()   \n",
    "print(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  CalendarId                 Date        Country                Category  \\\n",
      "0      87213  2016-12-01T13:30:00  United States  Initial Jobless Claims   \n",
      "1      87229  2016-12-08T13:30:00  United States  Initial Jobless Claims   \n",
      "2      87240  2016-12-15T13:30:00  United States  Initial Jobless Claims   \n",
      "3      87249  2016-12-22T13:30:00  United States  Initial Jobless Claims   \n",
      "4      87260  2016-12-29T13:30:00  United States  Initial Jobless Claims   \n",
      "5     144647  2017-01-05T13:30:00  United States  Initial Jobless Claims   \n",
      "6     144663  2017-01-12T13:30:00  United States  Initial Jobless Claims   \n",
      "7     144673  2017-01-19T13:30:00  United States  Initial Jobless Claims   \n",
      "8     144683  2017-01-26T13:30:00  United States  Initial Jobless Claims   \n",
      "9     144694  2017-02-02T13:30:00  United States  Initial Jobless Claims   \n",
      "\n",
      "                    Event Reference Unit                    Source Actual  \\\n",
      "0  Initial Jobless Claims    Nov/26       U.S. Department of Labor   268K   \n",
      "1  Initial Jobless Claims    Dec/03       U.S. Department of Labor   258K   \n",
      "2  Initial Jobless Claims    Dec/10       U.S. Department of Labor   254K   \n",
      "3  Initial Jobless Claims    Dec/17       U.S. Department of Labor   275K   \n",
      "4  Initial Jobless Claims    Dec/24       U.S. Department of Labor   265K   \n",
      "5  Initial Jobless Claims    Dec/31       U.S. Department of Labor   235K   \n",
      "6  Initial Jobless Claims    Jan/07       U.S. Department of Labor   247K   \n",
      "7  Initial Jobless Claims    Jan/14       U.S. Department of Labor   234K   \n",
      "8  Initial Jobless Claims    Jan/21       U.S. Department of Labor   259K   \n",
      "9  Initial Jobless Claims    Jan/28       U.S. Department of Labor   246K   \n",
      "\n",
      "  Previous Forecast TEForecast  Importance  \n",
      "0     251K     253K     253.1K           2  \n",
      "1     268K     258K       263K           2  \n",
      "2     258K     255K       256K           2  \n",
      "3     254K     256K       256K           2  \n",
      "4     275K     264K       271K           2  \n",
      "5     263K     240K       264K           2  \n",
      "6     237K     245K       244K           2  \n",
      "7     249K      240       247K           2  \n",
      "8     237K     247K       247K           2  \n",
      "9     260K     250K       247K           2  \n"
     ]
    }
   ],
   "source": [
    "mydata = te.getCalendarData(country = ['japan', 'china'], category = [' Unemployment Rate','Balance of Trade'], initDate = '2017-01-01', endDate = '2018-01-01', output_type= 'df' )\n",
    "print(mydata)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>CalendarId</th>\n",
       "      <th>Date</th>\n",
       "      <th>Country</th>\n",
       "      <th>Category</th>\n",
       "      <th>Event</th>\n",
       "      <th>Reference</th>\n",
       "      <th>Unit</th>\n",
       "      <th>Source</th>\n",
       "      <th>Actual</th>\n",
       "      <th>Previous</th>\n",
       "      <th>Forecast</th>\n",
       "      <th>TEForecast</th>\n",
       "      <th>Importance</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>87213</td>\n",
       "      <td>2016-12-01T13:30:00</td>\n",
       "      <td>United States</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Nov/26</td>\n",
       "      <td></td>\n",
       "      <td>U.S. Department of Labor</td>\n",
       "      <td>268K</td>\n",
       "      <td>251K</td>\n",
       "      <td>253K</td>\n",
       "      <td>253.1K</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>87229</td>\n",
       "      <td>2016-12-08T13:30:00</td>\n",
       "      <td>United States</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Dec/03</td>\n",
       "      <td></td>\n",
       "      <td>U.S. Department of Labor</td>\n",
       "      <td>258K</td>\n",
       "      <td>268K</td>\n",
       "      <td>258K</td>\n",
       "      <td>263K</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>87240</td>\n",
       "      <td>2016-12-15T13:30:00</td>\n",
       "      <td>United States</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Dec/10</td>\n",
       "      <td></td>\n",
       "      <td>U.S. Department of Labor</td>\n",
       "      <td>254K</td>\n",
       "      <td>258K</td>\n",
       "      <td>255K</td>\n",
       "      <td>256K</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>87249</td>\n",
       "      <td>2016-12-22T13:30:00</td>\n",
       "      <td>United States</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Dec/17</td>\n",
       "      <td></td>\n",
       "      <td>U.S. Department of Labor</td>\n",
       "      <td>275K</td>\n",
       "      <td>254K</td>\n",
       "      <td>256K</td>\n",
       "      <td>256K</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>87260</td>\n",
       "      <td>2016-12-29T13:30:00</td>\n",
       "      <td>United States</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Dec/24</td>\n",
       "      <td></td>\n",
       "      <td>U.S. Department of Labor</td>\n",
       "      <td>265K</td>\n",
       "      <td>275K</td>\n",
       "      <td>264K</td>\n",
       "      <td>271K</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>144647</td>\n",
       "      <td>2017-01-05T13:30:00</td>\n",
       "      <td>United States</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Dec/31</td>\n",
       "      <td></td>\n",
       "      <td>U.S. Department of Labor</td>\n",
       "      <td>235K</td>\n",
       "      <td>263K</td>\n",
       "      <td>240K</td>\n",
       "      <td>264K</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>144663</td>\n",
       "      <td>2017-01-12T13:30:00</td>\n",
       "      <td>United States</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Jan/07</td>\n",
       "      <td></td>\n",
       "      <td>U.S. Department of Labor</td>\n",
       "      <td>247K</td>\n",
       "      <td>237K</td>\n",
       "      <td>245K</td>\n",
       "      <td>244K</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>144673</td>\n",
       "      <td>2017-01-19T13:30:00</td>\n",
       "      <td>United States</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Jan/14</td>\n",
       "      <td></td>\n",
       "      <td>U.S. Department of Labor</td>\n",
       "      <td>234K</td>\n",
       "      <td>249K</td>\n",
       "      <td>240</td>\n",
       "      <td>247K</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>144683</td>\n",
       "      <td>2017-01-26T13:30:00</td>\n",
       "      <td>United States</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Jan/21</td>\n",
       "      <td></td>\n",
       "      <td>U.S. Department of Labor</td>\n",
       "      <td>259K</td>\n",
       "      <td>237K</td>\n",
       "      <td>247K</td>\n",
       "      <td>247K</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>144694</td>\n",
       "      <td>2017-02-02T13:30:00</td>\n",
       "      <td>United States</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Jan/28</td>\n",
       "      <td></td>\n",
       "      <td>U.S. Department of Labor</td>\n",
       "      <td>246K</td>\n",
       "      <td>260K</td>\n",
       "      <td>250K</td>\n",
       "      <td>247K</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  CalendarId                 Date        Country                Category  \\\n",
       "0  87213      2016-12-01T13:30:00  United States  Initial Jobless Claims   \n",
       "1  87229      2016-12-08T13:30:00  United States  Initial Jobless Claims   \n",
       "2  87240      2016-12-15T13:30:00  United States  Initial Jobless Claims   \n",
       "3  87249      2016-12-22T13:30:00  United States  Initial Jobless Claims   \n",
       "4  87260      2016-12-29T13:30:00  United States  Initial Jobless Claims   \n",
       "5  144647     2017-01-05T13:30:00  United States  Initial Jobless Claims   \n",
       "6  144663     2017-01-12T13:30:00  United States  Initial Jobless Claims   \n",
       "7  144673     2017-01-19T13:30:00  United States  Initial Jobless Claims   \n",
       "8  144683     2017-01-26T13:30:00  United States  Initial Jobless Claims   \n",
       "9  144694     2017-02-02T13:30:00  United States  Initial Jobless Claims   \n",
       "\n",
       "                    Event Reference Unit                    Source Actual  \\\n",
       "0  Initial Jobless Claims  Nov/26         U.S. Department of Labor  268K    \n",
       "1  Initial Jobless Claims  Dec/03         U.S. Department of Labor  258K    \n",
       "2  Initial Jobless Claims  Dec/10         U.S. Department of Labor  254K    \n",
       "3  Initial Jobless Claims  Dec/17         U.S. Department of Labor  275K    \n",
       "4  Initial Jobless Claims  Dec/24         U.S. Department of Labor  265K    \n",
       "5  Initial Jobless Claims  Dec/31         U.S. Department of Labor  235K    \n",
       "6  Initial Jobless Claims  Jan/07         U.S. Department of Labor  247K    \n",
       "7  Initial Jobless Claims  Jan/14         U.S. Department of Labor  234K    \n",
       "8  Initial Jobless Claims  Jan/21         U.S. Department of Labor  259K    \n",
       "9  Initial Jobless Claims  Jan/28         U.S. Department of Labor  246K    \n",
       "\n",
       "  Previous Forecast TEForecast  Importance  \n",
       "0  251K     253K     253.1K     2           \n",
       "1  268K     258K     263K       2           \n",
       "2  258K     255K     256K       2           \n",
       "3  254K     256K     256K       2           \n",
       "4  275K     264K     271K       2           \n",
       "5  263K     240K     264K       2           \n",
       "6  237K     245K     244K       2           \n",
       "7  249K     240      247K       2           \n",
       "8  237K     247K     247K       2           \n",
       "9  260K     250K     247K       2           "
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "\n",
    "df = te.getCalendarData(country = ['japan', 'china'], category = [' Unemployment Rate','Balance of Trade'], initDate = '2017-01-01', endDate = '2018-01-01', output_type= 'df' )\n",
    "\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       " <span style=\"color:green\"><h1 style=\"text-align:center\">China and Japan Unemployment Rate and Balance of Trade</h1> </span>  "
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>CalendarId</th>\n",
       "      <th>Date</th>\n",
       "      <th>Country</th>\n",
       "      <th>Category</th>\n",
       "      <th>Event</th>\n",
       "      <th>Reference</th>\n",
       "      <th>Unit</th>\n",
       "      <th>Source</th>\n",
       "      <th>Actual</th>\n",
       "      <th>Previous</th>\n",
       "      <th>Forecast</th>\n",
       "      <th>TEForecast</th>\n",
       "      <th>Importance</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>87213</td>\n",
       "      <td>2016-12-01T13:30:00</td>\n",
       "      <td>United States</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Nov/26</td>\n",
       "      <td></td>\n",
       "      <td>U.S. Department of Labor</td>\n",
       "      <td>268K</td>\n",
       "      <td>251K</td>\n",
       "      <td>253K</td>\n",
       "      <td>253.1K</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>87229</td>\n",
       "      <td>2016-12-08T13:30:00</td>\n",
       "      <td>United States</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Dec/03</td>\n",
       "      <td></td>\n",
       "      <td>U.S. Department of Labor</td>\n",
       "      <td>258K</td>\n",
       "      <td>268K</td>\n",
       "      <td>258K</td>\n",
       "      <td>263K</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>87240</td>\n",
       "      <td>2016-12-15T13:30:00</td>\n",
       "      <td>United States</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Dec/10</td>\n",
       "      <td></td>\n",
       "      <td>U.S. Department of Labor</td>\n",
       "      <td>254K</td>\n",
       "      <td>258K</td>\n",
       "      <td>255K</td>\n",
       "      <td>256K</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>87249</td>\n",
       "      <td>2016-12-22T13:30:00</td>\n",
       "      <td>United States</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Dec/17</td>\n",
       "      <td></td>\n",
       "      <td>U.S. Department of Labor</td>\n",
       "      <td>275K</td>\n",
       "      <td>254K</td>\n",
       "      <td>256K</td>\n",
       "      <td>256K</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>87260</td>\n",
       "      <td>2016-12-29T13:30:00</td>\n",
       "      <td>United States</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Dec/24</td>\n",
       "      <td></td>\n",
       "      <td>U.S. Department of Labor</td>\n",
       "      <td>265K</td>\n",
       "      <td>275K</td>\n",
       "      <td>264K</td>\n",
       "      <td>271K</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>144647</td>\n",
       "      <td>2017-01-05T13:30:00</td>\n",
       "      <td>United States</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Dec/31</td>\n",
       "      <td></td>\n",
       "      <td>U.S. Department of Labor</td>\n",
       "      <td>235K</td>\n",
       "      <td>263K</td>\n",
       "      <td>240K</td>\n",
       "      <td>264K</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>144663</td>\n",
       "      <td>2017-01-12T13:30:00</td>\n",
       "      <td>United States</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Jan/07</td>\n",
       "      <td></td>\n",
       "      <td>U.S. Department of Labor</td>\n",
       "      <td>247K</td>\n",
       "      <td>237K</td>\n",
       "      <td>245K</td>\n",
       "      <td>244K</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>144673</td>\n",
       "      <td>2017-01-19T13:30:00</td>\n",
       "      <td>United States</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Jan/14</td>\n",
       "      <td></td>\n",
       "      <td>U.S. Department of Labor</td>\n",
       "      <td>234K</td>\n",
       "      <td>249K</td>\n",
       "      <td>240</td>\n",
       "      <td>247K</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>144683</td>\n",
       "      <td>2017-01-26T13:30:00</td>\n",
       "      <td>United States</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Jan/21</td>\n",
       "      <td></td>\n",
       "      <td>U.S. Department of Labor</td>\n",
       "      <td>259K</td>\n",
       "      <td>237K</td>\n",
       "      <td>247K</td>\n",
       "      <td>247K</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>144694</td>\n",
       "      <td>2017-02-02T13:30:00</td>\n",
       "      <td>United States</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Initial Jobless Claims</td>\n",
       "      <td>Jan/28</td>\n",
       "      <td></td>\n",
       "      <td>U.S. Department of Labor</td>\n",
       "      <td>246K</td>\n",
       "      <td>260K</td>\n",
       "      <td>250K</td>\n",
       "      <td>247K</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "from IPython.display import display, HTML\n",
    "\n",
    "display(HTML(' <span style=\"color:green\"><h1 style=\"text-align:center\">China and Japan Unemployment Rate and Balance of Trade</h1> </span>  '))\n",
    "\n",
    "df = te.getCalendarData(country = ['japan', 'china'], category = [' Unemployment Rate','Balance of Trade'], initDate = '2017-01-01', endDate = '2018-01-01', output_type= 'df' )\n",
    "display(HTML(df.to_html()))\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.16"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
